<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>

    <script src="https://unpkg.com/vue"></script>
    <link rel="stylesheet" href="https://unpkg.com/element-plus/dist/index.css" />
    <script src="https://unpkg.com/element-plus"></script>
</head>

<body>
    <div id="app">
        <el-input v-model="text"></el-input>
        <el-input v-model="text1"></el-input>
        <el-input type="textarea" v-model="text2"></el-input>
        <el-button type="primary" @click="onClick">测试</el-button>
    </div>

    <script>
        const { createApp, ref, reactive, toRefs } = Vue;
        const vue3Composition = {
            setup() {
                const text = ref('text')

                const onClick = () => {
                    console.log(text.value, data.text1, data.text2);
                }

                const data = reactive({
                    text1: 'text1',
                    text2: 'text2',
                })

                const dataRef = toRefs(data);

                return {
                    ...dataRef,
                    text,
                    onClick
                }
            }
        }

        const app = createApp(vue3Composition)
            .use(ElementPlus)
            .mount('#app');

    </script>
</body>

</html>
